package com.tac.controller.wms;

import com.github.pagehelper.PageInfo;
import com.tac.common.result.Result;
import com.tac.pojo.wms.InventoryApprovalManagement;
import com.tac.service.wms.InventoryApprovalManagementService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.format.annotation.DateTimeFormat;
import org.springframework.web.bind.annotation.*;

import java.util.Date;

@RequestMapping("/inventoryApprovalManagement")
@CrossOrigin
@Api(tags = "智能仓储WMS--入库申请")
@RestController
public class InventoryApprovalManagementController {

    @Autowired
    private InventoryApprovalManagementService inventoryApprovalManagementService;

    //查看入库申请列表
    @GetMapping("/getList")
    @ApiOperation("查看入库申请列表")
    public Result<PageInfo<InventoryApprovalManagement>> getList(Integer pageNum, Integer pageSize, String applicationNumber, String relatedDocumentNumber, String businessType, String supplier
            , String contractNumber, String contractType, String applicant, @DateTimeFormat(pattern = "yyyy-MM-dd") Date applicationDateStart,@DateTimeFormat(pattern = "yyyy-MM-dd") Date applicationDateEnd, String applicationStatus
            ,String reviewer, @DateTimeFormat(pattern = "yyyy-MM-dd")Date reviewDateStart,@DateTimeFormat(pattern = "yyyy-MM-dd") Date reviewDateEnd, String reviewStatus){
        return inventoryApprovalManagementService.getList(pageNum,pageSize,
                applicationNumber,relatedDocumentNumber,businessType,supplier,
                contractNumber,contractType,applicant,applicationDateStart,
                applicationDateEnd,applicationStatus,reviewer,reviewDateStart,reviewDateEnd,reviewStatus);
    }


    //修改审核意见
    @PutMapping("/update")
    @ApiOperation("修改审核意见")
    public Result update(@RequestBody InventoryApprovalManagement inventoryApprovalManagement){
        return inventoryApprovalManagementService.update(inventoryApprovalManagement);
    }
}
